﻿define(["service/service", "service/httpService"], function (service) {
    service.factory("tokenUserService", function (httpService) {
        var methods = {
            gets: function (params) {
                return httpService.get("/admin/tokenUser/gets", params);
            },
            get: function (params) {
                return httpService.post("/admin/tokenUser/get", params);
            },
            save: function (params) {
                return httpService.post("/admin/tokenUser/save", params);
            },
            "modify_pwd": function (user_id, password) {
                return httpService.post("/admin/tokenUser/UpdatePwd", { user_id: user_id, password: password});
            },
            "updateDisabled": function (merchant_id, isDisabled) {
                return httpService.post("/admin/tokenUser/updateDisabled", { merchant_id: merchant_id, isDisabled: isDisabled });
            },
            "getTokenUserInvitationRanking": function (params) {
                return httpService.get("/admin/tokenUser/getTokenUserInvitationRanking", params);
            },
            "getTokenUserInvitationHis": function (userId, begin_time, end_time) {
                return httpService.get("/admin/tokenUser/getTokenUserInvitationHis", { userId: userId, begin_time: begin_time, end_time: end_time });
            },
            "increaseUserHorsePower": function (userId, horsePower, day) {
                return httpService.post("/admin/tokenUser/increaseUserHorsePower", { userId: userId, horsePower: horsePower, day: day});
            },
            "updateUserType": function (userId, userType) {
                return httpService.post("/admin/tokenUser/updateUserType", { userId: userId, userType: userType });
            },
            "updateUserParent": function (userId, parentMobile) {
                return httpService.post("/admin/tokenUser/updateUserParent", { userId: userId, parentMobile: parentMobile });
            },
            "turnRedDiamond": function (params) {
                return httpService.post("/admin/tokenUser/UserRedTransfer", params);
            },
            "getAuthInfoList": function (params) {
                return httpService.get("/admin/tokenUser/GetAuthInfos", params);
            },
            "getAuthInfo": function (params) {
                return httpService.get("/admin/tokenUser/GetAuthInfo", params);
            },
            "authInfoAudit": function (params) {
                return httpService.post("/admin/tokenUser/AuthInfoAudit", params);
            },
            "resetAuthNum": function (auth_id) {
                return httpService.post("/admin/tokenUser/resetAuthNum", { id: auth_id });
            },
        }
        return methods;
    });
});